/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-22
 * Time: 19:27
 */
public class Studnet implements Comparable<Studnet> {
    public String name;
    public int age;

    public Studnet(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Studnet{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public int compareTo(Studnet o) {
        //return this.name.compareTo(o.name);
        return this.age - o.age;
    }
}
